import request from '../utils/request';
import { getToken } from '../utils/auth';

/* 数据字典 */

    /* 列表 */
    export function dictionaryList (data) {
        return request({
            url: '/user/authority',
            method: 'get',
            params:data
        })
    }
    /* 新增 */
    export function pusherInfoAdd (data) {
        return request({
            url: '/pusher-client/info/add',
            method: 'POST',
            data
        })
    }
    /* 编辑 */
    export function pusherInfoEdit (data) {
        return request({
            url: '/pusher-client/info/update/'+data.id,
            method: 'PUT',
            data
        })
    }
    /* 删除 */
    export function pusherInfoDel (data) {
        return request({
            url: '/pusher-client/info/delete/'+data.id,
            method: 'delete',
           
        })
    }

/* 角色设置 */

    /* 列表 */
    export function roleList (data) {
        return request({
            url: '/user/role',
            method: 'get',
            params:data
        })
    }
    /* 新增 */
    export function roleAdd (data) {
        return request({
            url: '/user/role',
            method: 'POST',
            data
        })
    }
    /* 编辑 */
    export function roleEdit (data) {
        return request({
            url: '/user/role/'+data.id,
            method: 'PUT',
            data
        })
    }
    /* 删除 */
    export function roleDel (data) {
        return request({
            url: '/user/role/'+data.id,
            method: 'delete',
           
        })
    }

    /* 账户设置 */

    /* 列表 */
    export function accountList (data) {
        return request({
            url: '/user/info',
            method: 'get',
            params:data
        })
    }
    /* 新增 */
    export function accountAdd (data) {
        return request({
            url: '/user/info',
            method: 'POST',
            data
        })
    }
    /* 编辑 */
    export function accountEdit (data) {
        return request({
            url: '/user/info/'+data.id,
            method: 'PUT',
            data
        })
    }
    /* 删除 */
    export function accountDel (data) {
        return request({
            url: '/user/'+data.id,
            method: 'delete',
           
        })
    }
    /* 系统设置 */

        /* 列表 */
        export function systenList (data) {
            return request({
                url: '/user/config',
                method: 'get',
                params:data
            })
        }
        /* 新增 */
        export function systenEdit (data) {
            return request({
                url: '/user/config/'+data.id,
                method: 'PUT',
                data
            })
        }
        /* 修改密码 */
        export function changePSD (data) {
            return request({
                url: '/user/info/update/'+getToken(),
                method: 'PUT',
                params:data
            })
        }

       